package org.spider.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author lzy
 * @since 2022-06-02 15:36:46
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("spider_db_article")
@ApiModel(value = "SpiderDbArticleEntity对象", description = "")
public class SpiderDbArticleEntity extends Model<SpiderDbArticleEntity> {

    @ApiModelProperty("主键")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @ApiModelProperty("文章唯一id，MD5(doc_id+channel_id+site_id+data_source+doc_type)")
    @TableField("doc_uniq_id")
    private String docUniqId;

    @ApiModelProperty("文章id")
    @TableField("doc_id")
    private String docId;

    @ApiModelProperty("文章url")
    @TableField("doc_url")
    private String docUrl;

    @ApiModelProperty("文章urlMD5")
    @TableField("doc_url_md5")
    private String docUrlMd5;

    @ApiModelProperty("内容")
    @TableField("doc_content")
    private String docContent;

    @ApiModelProperty("文章摘要")
    @TableField("doc_summary")
    private String docSummary;

    @ApiModelProperty("标题")
    @TableField("doc_title")
    private String docTitle;

    @ApiModelProperty("发布时间")
    @TableField("doc_pubtime")
    private LocalDateTime docPubtime;

    @ApiModelProperty("作者")
    @TableField("doc_author")
    private String docAuthor;

    @ApiModelProperty("文章来源")
    @TableField("doc_source")
    private String docSource;

    @ApiModelProperty("文章标签")
    @TableField("doc_tags")
    private String docTags;

    @ApiModelProperty("文件映射json")
    @TableField("doc_files")
    private String docFiles;

    @ApiModelProperty("文章类型，1：web；2：app；3：小程序；4：公众号；5：社交媒体")
    @TableField("doc_type")
    private Integer docType;

    @ApiModelProperty("文章发表所在地")
    @TableField("doc_location")
    private String docLocation;

    @ApiModelProperty("文章引用数量")
    @TableField("doc_quote_count")
    private Integer docQuoteCount;

    @ApiModelProperty("文章评论数量")
    @TableField("doc_comment_count")
    private Integer docCommentCount;

    @ApiModelProperty("文章转发数量")
    @TableField("doc_retweet_count")
    private Integer docRetweetCount;

    @ApiModelProperty("文章点赞数量")
    @TableField("doc_like_count")
    private Integer docLikeCount;

    @ApiModelProperty("文章被观看数量")
    @TableField("doc_view_count")
    private Integer docViewCount;

    @ApiModelProperty("文章反对数量")
    @TableField("doc_opposed_count")
    private Integer docOpposedCount;

    @ApiModelProperty("关联频道id")
    @TableField("doc_channel_id")
    private Long docChannelId;

    @ApiModelProperty("关联站点id")
    @TableField("doc_site_id")
    private Long docSiteId;

    @ApiModelProperty("文章使用规则id")
    @TableField("doc_rule_id")
    private Long docRuleId;

    @ApiModelProperty("关联语言id")
    @TableField("doc_language_id")
    private Long docLanguageId;

    @ApiModelProperty("关联用户id")
    @TableField("doc_user_id")
    private Long docUserId;

    @ApiModelProperty("关联国家id")
    @TableField("doc_country_id")
    private Long docCountryId;

    @ApiModelProperty("文章父级id")
    @TableField("doc_parent_id")
    private Long docParentId;

    @ApiModelProperty("数据来源，1：自采；2：外部导入；3：采集过程中产生")
    @TableField("data_source")
    private Integer dataSource;

    @ApiModelProperty("创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty("更新时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @ApiModelProperty("采集时间")
    @TableField("crawler_time")
    private LocalDateTime crawlerTime;


    @Override
    public Serializable pkVal() {
        return this.id;
    }

}
